<?php

namespace api\modules\app\models;

use Yii;

/**
 * This is the model class for table "qrcode_deploy".
 *
 * @property integer $id
 * @property integer $user_id
 * @property string $user_name
 * @property string $created_at
 * @property string $district
 * @property string $district_name
 * @property string $community_code
 * @property string $estate_code
 * @property string $community_name
 * @property string $estate_name
 * @property integer $street_count
 * @property integer $grid_count
 * @property integer $road_count
 * @property integer $event_type_count
 * @property integer $unit_count
 * @property integer $bind_unit_count
 * @property string $request
 * @property integer $state
 */
class QrcodeDeploy extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'qrcode_deploy';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('test_3');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'street_count', 'grid_count', 'road_count', 'event_type_count', 'unit_count', 'bind_unit_count', 'state'], 'integer'],
            [['created_at'], 'safe'],
            [['request'], 'string'],
            [['user_name', 'district', 'district_name'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => 'User ID',
            'user_name' => 'User Name',
            'created_at' => 'Created At',
            'district' => 'District',
            'district_name' => 'District Name',
            'street_count' => 'Street Count',
            'grid_count' => 'Grid Count',
            'road_count' => 'Road Count',
            'event_type_count' => 'Event Type Count',
            'unit_count' => 'Unit Count',
            'bind_unit_count' => 'Bind Unit Count',
            'request' => 'Request',
            'state' => 'State',
            'community_code' => 'Community Code',
            'estate_code' => 'Estate Code',
            'community_name' => 'Community Name',
            'estate_name' => 'Estate Name',
        ];
    }
}
